The invention generally relates to configuring a device connected to a computer, and more particularly, to a technique for reading the configuration read-only memory in a serial bus device.
In this description and the accompanying claims, the following terms have meanings as indicated, unless the context otherwise requires: ROM read-only memory quadlet four consecutive bytes
It is common for personal computers to connect to other devices over a serial connection bus. A computer communicates with a serial bus device using a device driver program. Some serial buses such as IEEE 1212 compliant buses use devices with a configuration ROM on them. When a new device is connected, the computer uses the serial bus to read configuration ROM in the new device. This information is needed, for example, to determine what driver to use with the new device. This may occur, for example, after a reset signal is sent. Further details of device identification following a reset signal are provided in applicants"" copending application entitled xe2x80x9cMethod And Program Code For Identifying New Nodes On A Bus Following A Reset,xe2x80x9d having the same assignee and filing date, and which is hereby incorporated herein by reference.
IEEE 1212 defines configuration ROM that can be used by serial bus devices, and IEEE 1394-1995, also known as Firewire, further refines it. The contents of IEEE 1212 and 1394-1995 are hereby incorporated herein by reference. In IEEE 1394-1995 compliant devices, the configuration ROM is 1024 bytes in size, which can be read only 4 bytes (called a quadlet) at a time. Thus, straightforwardly reading the entire configuration ROM of a newly attached device requires 256 bus transactions.
Embodiments of the present invention are based on reading configuration ROM having a directory tree structure such as defined by IEEE 1212, by following the directory tree structure. This approach reduces the number of bus transactions needed to read all of the configuration ROM, thereby increasing the speed and efficiency of the system. In one specific embodiment, the configuration ROM follows the IEEE 1212 and/or 1394 standards, using an IEEE 1394 bus. This information may then be used, for example, to bind a corresponding device driver to the serial bus device.
One embodiment is based on maintaining a directory stack. Initially, the root directory of the configuration ROM is set as a current directory. The second step reads all the quadlets in the current directory. The third step scans the current directory for indirect entries, and if one is found, the current position of the scan is pushed onto the directory stack and the indirect entry is made the current directory; steps 2 and 3 are then repeated. Once no indirect entries are found in step 3, step 4 checks the directory stack, and if it is not empty, the top item is popped off, and the algorithm returns to step 3 at the scan position associated with the popped off item.